USE PayrollRedux

Create table EmployeeClassification
(
	EmployeeClassificationId char(1) Primary key,
	Name varchar(50) not null
)

Create table PaymentMethod
(
	PaymentMethodId char(1) Primary key,
	Name varchar(50) not null
)

Create table PaymentSchedule
(
	PaymentScheduleId char(1) Primary key,
	Name varchar(50) not null
)
GO
Create table Employee
(
	EmpId int identity PRIMARY KEY,
	Name varchar(50) not null,
	Adress varchar(100) not null,
	HourlyRate decimal(3,2) ,
	Salary int ,
	CommissionRate decimal(2,2),
	UnionCharge decimal (3,2),
	BankAccount varchar(50) ,
	BankName varchar(50),
	IsAffiliated bit not null,
	PaymentMethod char(1) not null references PaymentMethod (PaymentMethodId),
	PaymentSchedule char(1) not null references PaymentSchedule (PaymentScheduleId) ,
	Classification char(1) not null references EmployeeClassification (EmployeeClassificationId)
)
GO
Create table TimeCard
(
	TimeCardId int IDENTITY Primary Key,
	WorkDate date not null,
	WorkHours decimal(2,2) not null,
	Employee int not null references Employee (EmpId)
)

Create table SalesReceipt
(
	SalesReceipt int identity primary key,
	SalesDate date not null,
	Amount decimal (8,2) not null,
	Employee int not null references Employee (EmpId)
)

Create Table PaymentTrack
(
	PaymentTrackid int identity primary key,
	PayDate date not null,
	Amount decimal (6,2) not null,
	Remark varchar(250) ,
	Employee int not null references Employee (EmpId)
)